package com.yishuclass.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yishuclass.common.domain.model.YsExchangeCodeList;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Update;

/**
 * @ClassName YsExchangeCodeListMapper
 * @Description TODO
 * @Author wangdongliang
 * @Date 2021/6/15 21:39
 */
public interface YsExchangeCodeListMapper extends BaseMapper<YsExchangeCodeList> {
    /**
     * 学校兑换人数+1
     * @param id
     */
    @Update("UPDATE `ys_school` SET `exchange_num` = `exchange_num`  + 1 WHERE id = #{id}")
    void incrExchangeNumBySchool(@Param("id") Integer id);

    /**
     * 年级兑换人数+1
     * @param id
     */
    @Update("UPDATE `ys_school_class` SET `exchange_num` = `exchange_num`  + 1 WHERE id = #{id}")
    void incrExchangeNumByClass(@Param("id") Integer id);
}
